<?php echo $this->fetch('member.header.html'); ?>
<style>
.kdorder_add {background:#dddddd;}
.kdorder_add td{background:#FFF; padding:8px;}
.kdorder_add .title_h1 {font-size:15px; color:#333; background:#d8ecfc; font-family:'Microsoft Yahei'}
.botton_submit {border:0;background:#ed5736;height:35px;width:120px;text-align:center;line-height:35px;font-family:"Microsoft YaHei";font-size:15px;color:#fff;cursor:pointer;border-radius:4px; margin-right:10px}
</style>
<div class="content_color">
<div class="content">
<?php echo $this->fetch('member.menu.html'); ?>
<div id="right">
<?php echo $this->fetch('member.submenu.html'); ?>
<div class="wrap">
<form action="" method="post" id="form_box">
<table cellspacing="1" width="100%" class="kdorder_add">
  <tr><td style="padding:12px 8px;background:#ffffe5;line-height:18px; font-size:13px">提示：请客户尽可能<a href="<?php echo url('app=my_kdorder&act=add'); ?>" target="_blank" class="links">填写运单</a>，否则运费较高。如已经填写了运单，则不需要再填写到货预报。到货预报是当您在购物网站订单成功后，获得购物网站发货到我们仓库的发货快递单号。预报给我们会提高仓储收发包裹管理，更加高效地处理您的包裹，如果您未对包裹做准确预报，可能会影响您的包裹处理速度。</td></tr>
  <tr>
      <td class="title_h1">注：*号为必填写项</td>
  </tr>
  <tr>
    <td>
  <table width="100%" class="table_fill">
    <tr>
      <th><em>*</em>到货仓库：</th>
      <td>
      <select name="cangku" id="cangku" class="select_class">
      <option value="0">=请选择=</option>
      <?php $_from = $this->_var['category']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'list');if (count($_from)):
    foreach ($_from AS $this->_var['key'] => $this->_var['list']):
?>
      <option value="<?php echo $this->_var['list']['cate_name']; ?>" <?php if ($this->_var['choose_xiangmu']['0'] == $this->_var['list']['cate_name']): ?>selected="selected"<?php endif; ?>><?php echo $this->_var['list']['cate_name']; ?></option>
      <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
      </select>        
      </td>
    </tr>
    <tr>
      <th><em>*</em>包裹运单号：</th>
      <td><p class="floatleft"><textarea name="yundanhao" class="text width_normal" id="yundanhao" style="height:50px;" ></textarea></p>
      <p class="floatleft" style="width:330px;padding-left:8px;color:#999">如果相同的物品可以批量添加，请录入您的包裹运单号，<br />如：789798798US，一行一个单号，按回车键换行。<br />重复或已存在的单号将会被过滤</p></td>
    </tr>
    <tr>
      <th><em>*</em>派件快递公司：</th>
      <td>
      <select name="PostOfficeID" id="PostOfficeID" class="select_class">
      <option value="">请选择</option>
      <?php $_from = $this->_var['kuaidi_data']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('i', 'list');if (count($_from)):
    foreach ($_from AS $this->_var['i'] => $this->_var['list']):
?><?php if ($this->_var['list']['type'] == "1"): ?>
      <option value="<?php echo $this->_var['list']['title']; ?>" <?php if ($this->_var['wupin']['PostOfficeID'] == $this->_var['list']['title']): ?>selected="selected"<?php endif; ?>><?php echo $this->_var['list']['title']; ?></option>
      <?php endif; ?><?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
      </select>      
      </td>
    </tr>
    <tr>
      <th><em>*</em>物品名称：</th>
      <td><input type="input" class="text width_normal" name="GoodsName" id="GoodsName" maxlength="250"/></td>
    </tr>
    <tr>
      <th><em>*</em>物品数量：</th>
      <td><input type="input" class="text width_normal" name="GoodsCount" id="GoodsCount" onKeyUp="clearNoNum(this)" maxlength="5"/> (件)</td>
    </tr>
    <tr>
      <th><em>*</em>物品价值：</th>
      <td><input type="input" class="text width_normal" name="GoodsWorth" id="GoodsWorth" onKeyUp="clearNoNum(this)" maxlength="10"/> ($)</td>
    </tr>
    <tr>
      <th><em>*</em>物品重量：</th>
      <td><input type="input" class="text width_normal" name="GoodsWeight" id="GoodsWeight" onKeyUp="clearNoNum(this)" maxlength="5"/> (LB)</td>
    </tr>
    <tr>
      <th>预报说明：</th>
      <td><textarea name="notes" id="notes" class="text" style="width:350px;height:50px;" placeholder="可以填写其他备注说明"><?php echo $this->_var['order_info']['notes']; ?></textarea></td>
    </tr>
    <tr>
      <th>&nbsp;</th>
      <td>
      <input type="button" name="imgButton" class="botton_submit" value="确认提交" onclick="return Check_form();" />
      <input type="reset" class="botton_submit" value="清空重写" style="background:#999"/>
      <?php if ($this->_var['yubao_info']['yubao_id']): ?>
      <input type="hidden" name="yubao_id"  value="<?php echo $this->_var['order_info']['yubao_id']; ?>"/><input type="hidden" name="act"  value="edit"/>
      <?php else: ?>
      <input type="hidden" name="act"  value="add"/>
      <?php endif; ?>
      <br /><br />
   </td>
    </tr>
  </table>
  </td>
  </tr>
  <tr>
      <td align="center" height="25"><span style="color:red;">客户委托承运的物品必须符合中华人民共和国法律法规要求。货物按照海关要求缴纳行邮税。请参阅：<a href="<?php echo url('app=article&act=abouts&code=charge'); ?>" target="_blank" class="links">收费标准</a>，<a href="<?php echo url('app=article&act=abouts&code=importduty'); ?>" target="_blank" class="links">行邮税率表</a>，<a href="<?php echo url('app=article&act=abouts&code=chinaimpor'); ?>" target="_blank" class="links">禁止进境物品</a>。</span></td>
  </tr>
</table>
</form>
</div></div>
<div class="clear"></div>
</div>
</div>
<script type="text/javascript">
//sumbit form
function Check_form() {
  if ($("#cangku").val() == "0") {alert("请选择到货仓库");$("#cangku").focus(); return false;}
  if ($("#yundanhao").val() == "") {alert("请输入包裹运单号");$("#yundanhao").focus(); return false;}
  if ($("#PostOfficeID").val() == "") {alert("请选择派件快递公司");$("#PostOfficeID").focus(); return false;}
  if ($("#GoodsName").val() == "") {alert("请输入物品名称");$("#GoodsName").focus(); return false;}
  if ($("#GoodsCount").val() == "") {alert("请输入物品数量");$("#GoodsCount").focus(); return false;}
  if ($("#GoodsWorth").val() == "") {alert("请输入物品价值");$("#GoodsWorth").focus(); return false;}
  if ($("#GoodsWeight").val() == "") {alert("请输入物品重量");$("#GoodsWeight").focus(); return false;}
  $("#form_box").submit();
}
function clearNoNum(obj) {
  obj.value = obj.value.replace(/[^\d.]/g, "");  //清除"数字"和"."以外的字符 
  obj.value = obj.value.replace(/^\./g, "");  //验证第一个字符是数字而不是. 
  obj.value = obj.value.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的. 
  obj.value = obj.value.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
}
</script>
<?php echo $this->fetch('footer_member.html'); ?>